//
//  TopicViewCell.m
//  cookBook
//
//  Created by xalo on 16/1/23.
//  Copyright © 2016年 张广斌. All rights reserved.
//

#import "TopicViewCell.h"
#import "Model.h"
#import <UIImageView+WebCache.h>
@implementation TopicViewCell


//根据model设置cell的内容
-(void) setContentViewWithModel:(Model *)model
{
    //图片
    //判断如果不存在,网络请求
    if (model.pictureImage == nil) {
        
        [self.thumbImageView sd_setImageWithURL:[NSURL URLWithString:model.thumb] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
            
            model.pictureImage = image;
            
        }];
    }
    
    //如果存在
    self.thumbImageView.image = model.pictureImage;

    //标题
    self.titleLabel.text = model.title;
    

}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
